package 素数回文;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        long x = func(s);
        if (is_Prime(x)) {
            System.out.println("prime");
        } else {
            System.out.println("noprime");
        }
    }

    private static boolean is_Prime(long x) {
        if (x < 2) {
            return false;
        }
        for (int i = 2; i <= x / i; i++) {
            if (x % i == 0) {
                return false;
            }
        }
        return true;
    }

    private static long func(String s) {
        String ret = "";
        ret += s;
        for (int i = s.length() - 2; i >= 0; i--) {
            ret += s.charAt(i);
        }
        return Long.parseLong(ret);
    }
}
